<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <div>
            <form method="post" action="loginoperation.php">
                <input type="text" name="name" placeholder="请输入用户名"><br>
                <input type="password" name="password" placeholder="请输入密码"><br>
                <input type="text" name="code" placeholder="请输入验证码">
                <img src="code.php" alt="验证码">
                <button type="button">点击换一张</button><br>
                <input type="submit" value="登录">
            </form>
        </div>
    </body>
    <script type="text/javascript">
        var button=document.getElementsByTagName('button')[0];
        var img=document.getElementsByTagName('img')[0];
        button.onclick=function(){
            img.src='code.php?'+Math.random();
        }
    </script>
    
</html>
